package com.hxh.bank.branch.controller;

import com.hxh.bank.branch.spider.BankBranchSpider;
import com.hxh.bank.branch.vo.BankBranchVO;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author huangxunhui
 * Date: Created in 2021/5/16 13:27
 * Utils: IntelliJ IDEA
 * Description: 支行前端控制器
 */
@RestController
@AllArgsConstructor
@RequestMapping("/bank/branch")
public class BankBranchController {

    private final BankBranchSpider bankBranchSpider;

    /**
     * 查询支行信息
     *
     * @param bankBranchCode 支行联行号
     * @return 支行信息
     */
    @GetMapping("/search/{bankBranchCode}")
    public BankBranchVO search(@PathVariable("bankBranchCode") String bankBranchCode) {
        return bankBranchSpider.search(bankBranchCode);
    }

}
